<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	System.out.print(path);
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	System.out.print(basePath);
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>TI - 测试集成管理系统</title>
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
	function getPage(o) {
		//alert("change page!");
		//$("mainFramePage").src="http://www.baidu.com";
		document.getElementById("mainFramePage").src = o.id;
	}
	$(document).ready(function() {
		$("#phoneNumberUpdate").click(function() {
			/* alert("修改密码"); */
			if($("#changePhoneNumber").val().trim().length<3){
				alert("手机号码输入太短!");
				return;
			}
			var phoneNumber = $("#changePhoneNumber").val().trim();
			/* alert(password);
			alert(password.length); */
			/* $("#passwordUpdateForm").submit();
			alert("密码修改成功!"); */ 
			$.ajax({
				type : "POST",
				url : "phoneNumberUpdate.action?user.phoneNumber="+phoneNumber,
				data : "",
				success : function(json) {
					alert("手机号码修改成功!");
				},
				error : function(e) {
					alert("对不起，后台处理发生异常，请联系管理员!");
				}
			});
		});
		$("#passwordUpdate").click(function() {
			/* alert("修改密码"); */
			if($("#changePassword").val().trim().length<3){
				alert("密码输入太短!");
				return;
			}
			if ($("#changePassword").val() != $("#repeatPassword").val()) {
				alert("重复密码不匹配!");
				return;
			}
			var password = $("#changePassword").val().trim();
			/* alert(password);
			alert(password.length); */
			/* $("#passwordUpdateForm").submit();
			alert("密码修改成功!"); */ 
			$.ajax({
				type : "POST",
				url : "passwordUpdate.action?user.password="+password,
				data : "",
				success : function(json) {
					alert("密码修改成功!");
				},
				error : function(e) {
					alert("对不起，后台处理发生异常，请联系管理员!");
				}
			});
		});
	});
</script>
<style type="text/css">
/* html {
	height: 100%;
	margin: 0;
}

body {
	height: 100%;
	margin: 0;
}

.navbar-bootom {
	min-height: 50px;
} */
body {
	height: 100%;
	overflow: hidden;
	margin: 0px;
	padding: 0px;
}

.box {
	height: 100%;
	background: #ff0000;
	position: absolute;
	width: 100%;
}
</style>
</head>
<body style="padding: 0px">
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<div class="navbar-fixed-top" style="margin-top: 50px; bottom: 0px">
					<div style="z-index: 1">
						<iframe seamless="seamless" src="frame/welcome.jsp"
							frameBorder="0" id="mainFramePage"
							style="width: 100%; height: 100%"></iframe>
					</div>
				</div>
				<nav class="navbar navbar-default navbar-inverse navbar-fixed-top"
					role="navigation">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse"
							data-target="#bs-example-navbar-collapse-1">
							<span class="sr-only">Toggle navigation</span><span
								class="icon-bar"></span><span class="icon-bar"></span><span
								class="icon-bar"></span>
						</button>
						<a class="navbar-brand" href="javascript:void(0);"
							onclick="getPage(this)" id="frame/welcome.jsp"><!-- <em
							class="glyphicon glyphicon-fire"></em>  --><font size="5">Elong-QA-TI</font></a>
					</div>

					<div class="collapse navbar-collapse"
						id="bs-example-navbar-collapse-1">
						<ul class="nav navbar-nav">
							<s:iterator value="menuList" var="menuInfo">
								<s:if test="#menuInfo.parentId==0">
									<li class="dropdown"><a href="#" class="dropdown-toggle"
										data-toggle="dropdown"><s:property
												value="#menuInfo.menuName" /><strong class="caret"></strong></a>
										<ul class="dropdown-menu">
											<s:iterator value="menuList" var="menuInfoIn">
												<s:if
													test="#menuInfo.menuId==#menuInfoIn.parentId&&#menuInfoIn.parentId!=0">
													<li><s:a href="javascript:void(0);"
															id="%{#menuInfoIn.menuPath}" onclick="getPage(this)">
															<s:property value="#menuInfoIn.menuName" />
														</s:a></li>
												</s:if>
											</s:iterator>
										</ul></li>
								</s:if>
							</s:iterator>
						</ul>
						<ul class="nav navbar-nav navbar-right">
							<!-- <li><a href="#">统计</a></li> -->
							<li class="dropdown"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown"><em class="glyphicon glyphicon-user"></em>
									${ sessionScope.user.name }<%-- ${applicationScope.app} ${sessionScope.sess} ${requestScope.req} --%>
									<strong class="caret"></strong></a>
								<ul class="dropdown-menu">
									<li><a id="modal-86914" href="#modal-container-86914"
										data-toggle="modal">修改手机号码</a></li>
									<li><a id="modal-86913" href="#modal-container-86913"
										data-toggle="modal">修改密码</a></li>
									<li class="divider"></li>
									<li><a href="loginOut.action">注销登录</a></li>
								</ul></li>
						</ul>
					</div>
				</nav>
			</div>
			<div class="modal fade" id="modal-container-86914" role="dialog"
				aria-labelledby="myModalLabel" aria-hidden="true"
				data-backdrop="static">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">×</button>
							<h4 class="modal-title" id="myModalLabel">修改手机号码</h4>
						</div>
						<div class="modal-body">
							<form class="form-horizontal" role="form" id="phoneNumberUpdateForm"
								action="" methdo="POST">
								<div class="form-group">
									<label for="inputPassword3" class="col-sm-3 control-label">新手机号码</label>
									<div class="col-sm-8">
										<input class="form-control" id="changePhoneNumber"
											type="text" name="user.phoneNumber" />
									</div>
								</div>
						</div>
						<div class="modal-footer">
							<button type="reset" class="btn btn-default">重置</button>
							<button type="submit" class="btn btn-primary" id="phoneNumberUpdate"
								data-dismiss="modal">提交</button>
						</div>
						</form>
					</div>
				</div>
			</div>
			<div class="modal fade" id="modal-container-86913" role="dialog"
				aria-labelledby="myModalLabel" aria-hidden="true"
				data-backdrop="static">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">×</button>
							<h4 class="modal-title" id="myModalLabel">修改密码</h4>
						</div>
						<div class="modal-body">
							<form class="form-horizontal" role="form" id="passwordUpdateForm"
								action="" methdo="POST">
								<div class="form-group">
									<label for="inputPassword3" class="col-sm-3 control-label">输入新密码</label>
									<div class="col-sm-8">
										<input class="form-control" id="changePassword"
											type="password" name="user.password" />
									</div>
								</div>
								<div class="form-group">
									<label for="inputPassword3" class="col-sm-3 control-label">重复新密码</label>
									<div class="col-sm-8">
										<input class="form-control" id="repeatPassword"
											type="password" />
									</div>
								</div>
						</div>
						<div class="modal-footer">
							<button type="reset" class="btn btn-default">重置</button>
							<button type="submit" class="btn btn-primary" id="passwordUpdate"
								data-dismiss="modal">提交</button>
						</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>